// pages/show/show.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    array:[],
  },
  
  // 查看身份证人像面事件
  chakan1:function(e){
    var array=this.data.array;
    // console.log(array);
    // var idss = e.currentTarget;
    // console.log(idss)
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgcard;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  
  // 查看身份证国徽照事件
  chakan2:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    console.log(id);
    var item = array[id].imgcard2;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看征信授权书事件
  chakan3:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgzxsqs;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看手持授权书事件
  chakan4:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgscsqs;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看手持身份证正脸照事件
  chakan5:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgscsfz;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看驾驶证事件
  chakan6:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgjsz;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看银行卡事件
  chakan7:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgyhk;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看征信签字照事件
  chakan8:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgzxqzz;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看投保单和投保单签字照事件
  chakan9:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgtbd;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看申请表事件
  chakan10:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgsqb;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?item=' + item,
    })
  },
  // 查看其他资料事件
  chakan11:function(e){
    var array=this.data.array;
    // console.log(array);
    var id = e.currentTarget.dataset.index;
    // console.log(id);
    var item = array[id].imgqt;
    console.log(item);
    wx.navigateTo({
      url: '../look/look?itemss=' + item,
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 获取传达的订单号
    var orid = options.orid;
    console.log(orid);
    var that = this;
    wx.request({
      url: 'https://wx.wc5818.com/wxapp/api/getAllCustInfoForWhereLike',
      method: "GET",
      header: {
        "Content-Type": "application/json",
      },
      data: {
        orderid: orid
      },
      success(res) {

        if(!res.data){

          wx.showModal({
            title: '提示',
            content: '等待认领中...',
            confirmText: "确定",
            showCancel: false,
          })

          return;
        }
        // console.log(res);
        console.log(res.data);
        var data1 = res.data;
        that.setData({
          array: data1
        });
      }
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})